import pako from 'pako';

// 解压缩
export const unzip = (data) => {
	let gzipData = atob(data).split('').map(char => char.charCodeAt(0));
	let gzipArray = new Uint8Array(gzipData);
	let uncompressedData = pako.inflate(gzipArray);
	let result = new TextDecoder().decode(uncompressedData);
	result = JSON.parse(result);
	return result;
}